#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

void reverse(int arr1[10],int arr2[10],int sz)
{
	int j = 0;
	int k = 0;
	
	for (j = 0; j < sz; j++)
	{
		if (arr1[j] % 2 == 1)
		{
			arr2[k++] = arr1[j];
		}
	}
	int s = k;
	for (j = 0; j < sz; j++)
	{
		if (arr1[j] % 2 == 0)
		{
			arr2[s++] = arr1[j];
		}
	}

}

int main()
{
	int arr1[10] = { 0 };
	int arr2[10] = { 0 };
	int i = 0;
	int sz = sizeof(arr1) / sizeof(arr1[0]);
	const int* p = arr2;
	/*for (i = 0; i < sz; i++)//err
	{
		scanf("%d", p);
		p++;
	}*/
	for (i = 0; i < sz; i++)
	{
		scanf("%d", &arr1[i]);
	}

	reverse(arr1, arr2, sz);

	for (i = 0; i < sz; i++)
	{
		printf("%d ", *p);
		p++;
	}
	return 0;
}